package com.example.full_display


/*import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import com.sumscope.qeubee.moblie.BuildConfig
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import android.content.Context*/


import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity() {

    private val CHANNEL = "myChannel"

//    override protected fun onCreate(savedInstanceState: Bundle?) {
//        super.onCreate(savedInstanceState)
//
//    }

    /*override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)
        GeneratedPluginRegistrant.registerWith(this)
        MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
                object : MethodCallHandler() {
                    @Override
                    fun onMethodCall(call: MethodCall, result: Result) {
                        android.util.Log.d(TAG, "onMethodCall: $call")
                        if (call.method.equals("myMethod")) {
                            val screenBrightnessValue: Int = call.argument("screenBrightnessValue")
                            saveScreenBrightness(screenBrightnessValue)
//                            result.success(nativeResult)
                        } else {
                            result.notImplemented()
                        }
                    }
                }
        )
    }*/

}


/*fun setScrennManualMode() {
        val contentResolver: ContentResolver = getActivity().getContentResolver()
        try {
            val mode: Int = Settings.System.getInt(contentResolver,
                    Settings.System.SCREEN_BRIGHTNESS_MODE)
            if (mode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
                Settings.System.putInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS_MODE,
                        Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL)
            }
        } catch (e: Settings.SettingNotFoundException) {
            e.printStackTrace()
        }
    }

    private fun saveScreenBrightness(value: Int) {
        setScrennManualMode()
        val contentResolver: ContentResolver = getActivity().getContentResolver()
//        val value = 255 // 设置亮度值为255
        Settings.System.putInt(mContentResolver,
                Settings.System.SCREEN_BRIGHTNESS, value)
    }
}*/
